Repository navigation
Read the Google Advertising ID on every call, waiting by default up to 100 ms - #62
Open
jrosendahl-opt wants to merge 3 commits into
Open
jrosendahl-opt wants to merge 3 commits into
jrosendahl-opt wants to merge 3 commits into
Conversation
The SDK read the GAID once when an instance was created and kept it in a companion object shared by every instance, so a reset or opt-out was ignored until the process restarted, and an instance created with skipAdvertisingIdDetection still sent a GAID an earlier instance read. identify and targeting also waited for that read behind a 3 second timeout that couldn't interrupt the blocking getAdvertisingIdInfo(). Google says to call getAdvertisingIdInfo() each time the ID is needed and not to cache it. identify and targeting now read the GAID and the opt-out flag on every call, like the iOS SDK reads the IDFA, waiting at most OptableConfig.advertisingIdTimeoutMs (default 100 ms) before sending the call without it. Zero or less means don't wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It was an internal val, so an app had to create a new OptableConfig and OptableSDK when the user granted or withdrew consent for the advertising ID. Make it a public var, like origin and consents and like the iOS SDK; since the GAID is now read on every call, a change applies from the next call. Both advertising ID settings are @volatile, as calls read them on a background thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jrosendahl-opt
added a commit
that referenced
this pull request
Nov 10, 2026
Match #62: every identify and targeting call reads the GAID (never cached), waiting up to advertisingIdTimeoutMs (100 ms by default), and skipAdvertisingIdDetection can be changed at any time, applying from the next call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 10, 2026
A wait of zero or less skipped reading the GAID, so no ID could be added. Raise any value below 1 ms to 1 ms instead: reading the GAID always takes some time, typically tens of milliseconds depending on the device, which the docs now say. skipAdvertisingIdDetection is the way to never add it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jrosendahl-opt
added a commit
that referenced
this pull request
Nov 11, 2026
Match #62: advertisingIdTimeoutMs is at least 1 ms, so zero no longer means the GAID is not added, and reading the GAID typically takes tens of milliseconds depending on the device. skipAdvertisingIdDetection is the way to never add it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The SDK read the Google Advertising ID (GAID) once, when an instance was created, and kept it in a
companion objectshared by every instance:skipAdvertisingIdDetection = truestill sent a GAID an earlier instance had read.identifyandtargetingwaited for that first read behind a 3 second timeout that couldn't actually interrupt the blockinggetAdvertisingIdInfo().Google's guidance is to call
getAdvertisingIdInfo()each time the ID is needed and not to cache it, and the Play ads policy requires respecting the user's opt-out and reset. The iOS SDK already reads the IDFA on each call.